UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PzeOWlAJmQQXce3iMj+aNRmc0OrI1/L1EAni7NzG88M='
WHERE
key_id = 'fd02b1e1e1b946d63a9dcdbe1a30e807b5cbec0815969217d1502a6bdfa17e1e'
AND (
token = 'PzeOWlAJmQQXce3iMj+aNRmc0OrI1/L1EAni7NzG88M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)