UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1lfm1XFL6C5pBExftnqbfqxVuFay0AAN2UzwBdPenVI='
WHERE
key_id = 'd9b3ece04577fe834b8a5ddc137c4c2260731fd098fa82d8329a5fdd76e9c427'
AND (
token = '1lfm1XFL6C5pBExftnqbfqxVuFay0AAN2UzwBdPenVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)