UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K20lYYFqFS6yO7+rcTR8ASScGLzXZCIhcOSXJg/rsHs='
WHERE
key_id = '2f59fe38196fd0967bf4c29f04b745561c49d1363574a0096849c6df97be3c30'
AND (
token = 'K20lYYFqFS6yO7+rcTR8ASScGLzXZCIhcOSXJg/rsHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)