UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '64jNmDH/BNpiqBHiguSx++OFbf3U25JRLXgfr0aGsoA=' 
WHERE 
  key_id = '4aec2125e268314d8faca35e1923fa241614e6f855d8d813d6a0bdb7b0343e53' 
  AND (
    token = '64jNmDH/BNpiqBHiguSx++OFbf3U25JRLXgfr0aGsoA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026