UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gkTJCwGYZnCV9W2Y1TI1YFN6AngC0e945xu9kCHgg8c='
WHERE
key_id = '14436770256ee12084292942db096d33a4c60a57e75d0f682321d930803a213b'
AND (
token = 'gkTJCwGYZnCV9W2Y1TI1YFN6AngC0e945xu9kCHgg8c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)