UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cW/zYC4Nj2OsIOQKdMSmCX7xM+FSNcXvDZuL8e5HeRY=' 
WHERE 
  key_id = 'b5c5ab63057e2b6945700307bfb8990e7383e0056c4d01ce74e4f69478bf140f' 
  AND (
    token = 'cW/zYC4Nj2OsIOQKdMSmCX7xM+FSNcXvDZuL8e5HeRY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036