UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ya+Gr7o5bT1+SqpbwUekysJt1w8EWmnntCJqtXS/htY='
WHERE
key_id = 'f3ab55429a38ab79561bcbbc285ac31cb3fe7dd012ea072b9948812c6f611575'
AND (
token = 'ya+Gr7o5bT1+SqpbwUekysJt1w8EWmnntCJqtXS/htY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)