UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '60P+6m9LxMHGg5Q18ShQJLPMOvfDQvAoQtKASxwcrFE='
WHERE
key_id = '14c46a240c3f7bbc23aee4d4b71f83083b39af85449200700c3f3b939912e95b'
AND (
token = '60P+6m9LxMHGg5Q18ShQJLPMOvfDQvAoQtKASxwcrFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)