UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2oGfuSr5HZT5MQigkdLqi6v3eoAGL6qpTZg6I9xIs2w='
WHERE
key_id = '1be436c5e28c16b855ef587a82b71bc28930a23cbdae8613729bad2159798573'
AND (
token = '2oGfuSr5HZT5MQigkdLqi6v3eoAGL6qpTZg6I9xIs2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)