UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qDpnsjAqdBMYkMo8jO/82z0Deo73+k5J2pv1EK97CIo='
WHERE
key_id = 'eab876f111f4e502ef33544e0c7da8dfad6466e0ced27818e0152bcfd80042dd'
AND (
token = 'qDpnsjAqdBMYkMo8jO/82z0Deo73+k5J2pv1EK97CIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)