UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xpsYcKRgi60S56bw9nF0hw/BIYDhj+sb4mP+PAFNRxM='
WHERE
key_id = 'c3cac8ee98ff54917cdbdb868c7b72569f3f0c517eddb54d1fbbfacbd5eab701'
AND (
token = 'xpsYcKRgi60S56bw9nF0hw/BIYDhj+sb4mP+PAFNRxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)