UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QnCS+UnHiTOW+q5x31/PCSgFIfaIbuItl9CqSEIbhSY=' 
WHERE 
  key_id = 'ac7aaf494ede009a0391135c5988b80e5b58cfc882e92d8fa4b6a02db65b6d4a' 
  AND (
    token = 'QnCS+UnHiTOW+q5x31/PCSgFIfaIbuItl9CqSEIbhSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030