UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zEs5TBXfAfueCTWM57RUsHX5Kp8pbG8BQ9ttLcko9m4='
WHERE
key_id = '3e2fd3112f5f51f8fddb60fd14da5a91738e9687f06d5c84d92a1e2eaa31a237'
AND (
token = 'zEs5TBXfAfueCTWM57RUsHX5Kp8pbG8BQ9ttLcko9m4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)