UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TkEB1Wkm9UUe7d4NlRSiTuZz7TN/+vPC44fykHQEoL4='
WHERE
key_id = 'f0bce9e0a69f14eb96a0982ee6578e1ee86e7fbf02338ca15632a0b0cfd75e7d'
AND (
token = 'TkEB1Wkm9UUe7d4NlRSiTuZz7TN/+vPC44fykHQEoL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)