UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EYFf1W754lWAVvTTdng2T+rhabh8aYThpLT5x5qf3zY='
WHERE
key_id = '4e844ee4d66aeebd9ad7123221bd9d7467ec0e41ed810c6e016653a8bbb84b44'
AND (
token = 'EYFf1W754lWAVvTTdng2T+rhabh8aYThpLT5x5qf3zY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)