UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yeEuqsrkHYKASD+tjCq4E6+Fp+MQP0scHv+hgn6y1sg='
WHERE
key_id = 'b1ed93179ff24720d728512d520fe412de608cd68ec52b36f19f9b485a9e878d'
AND (
token = 'yeEuqsrkHYKASD+tjCq4E6+Fp+MQP0scHv+hgn6y1sg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)