UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LEr1ZWt+mk/xSr6/UCk3hAmLwuVUwyzxVVcyZ73lar8='
WHERE
key_id = '5ceb47ec25ba045cec8880deee68f5efa367c57f5c545096ec6016a5fb4b4e0c'
AND (
token = 'LEr1ZWt+mk/xSr6/UCk3hAmLwuVUwyzxVVcyZ73lar8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)