UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HoSq0X7O2Pni8v9AgDR3ldZp+XMLm9kcOuL+1XZ/0uY=' 
WHERE 
  key_id = 'fe62348333f0b6f23d0c6423a20ef6f567bfab5755ce28f964cc9aeb9fbffefc' 
  AND (
    token = 'HoSq0X7O2Pni8v9AgDR3ldZp+XMLm9kcOuL+1XZ/0uY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021