UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UVKYL8qpHlg6ExD/ig0gi95FOV1V+PqV7DWgG/orGx4='
WHERE
key_id = 'a7ae0fe1b43a06084dbb9a2fd9fa66ce327f739fbe87ef53de21d7159fcc6dae'
AND (
token = 'UVKYL8qpHlg6ExD/ig0gi95FOV1V+PqV7DWgG/orGx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)