UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N+2xaTU8z/rPqMEgl/9En9tDBIoiyh1CrRwWWRWQV3w='
WHERE
key_id = '955b51419916827127aad468edcfefc26cc4076ecc51eb6ec31aaaf53abc6aec'
AND (
token = 'N+2xaTU8z/rPqMEgl/9En9tDBIoiyh1CrRwWWRWQV3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)