UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HW4WMy4tzJm9WzIkW2GtxdhO/JjeL9iLX/1smGaIuqE=' 
WHERE 
  key_id = '0d917df37ab0c88e4f82c644b1cdea9390fbbd4126916350e4d392840065fe81' 
  AND (
    token = 'HW4WMy4tzJm9WzIkW2GtxdhO/JjeL9iLX/1smGaIuqE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031