UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6q+49fWQAdZ3Bx+nqo0fMdU7FV//ezM/xCKUVGENphg=' 
WHERE 
  key_id = '694408cd217bac70eca442db711a944676c8edff0b43f3d8b92201c37b1bfd28' 
  AND (
    token = '6q+49fWQAdZ3Bx+nqo0fMdU7FV//ezM/xCKUVGENphg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043