UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bYvTQaYybxgSWAJZgkP2lqFDRgN5WqKSf9w16nYL4HI='
WHERE
key_id = '8db2b95d6eaab28ee33ee12324843b5dcc517f1f66cbad544c6d385b8d4c19ff'
AND (
token = 'bYvTQaYybxgSWAJZgkP2lqFDRgN5WqKSf9w16nYL4HI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)