UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nfe8GlLgjQFHQFe8J2Aojv9oyPI6cpiriH0C4VgKrzs='
WHERE
key_id = '752c87304b7be460b536a8462e7a207d420f95c1efc232fad40a8e59fd9378e0'
AND (
token = 'nfe8GlLgjQFHQFe8J2Aojv9oyPI6cpiriH0C4VgKrzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)